//
//  TypeTableViewCell.m
//  Journey
//
//  Created by dllo on 16/5/24.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "TypeTableViewCell.h"

@implementation TypeTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self createType];
    }
    return self;
}


-(void)createType{
    self.nameLabel = [[UILabel alloc] init];
  //  self.nameLabel.backgroundColor = [UIColor grayColor];
    
    self.nameLabel.highlightedTextColor = YNColor(34, 139, 34);
    [self.contentView addSubview:self.nameLabel];
    
   
    
    self.view = [[UIView alloc] init];
    self.view.frame = CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height);
    self.view.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.view];
    
    self.lineView = [[UIView alloc] init];
    self.lineView.backgroundColor = YNColor(34, 139, 34);
    self.lineView.frame = CGRectMake(0, 0, 3, 60);
    [self.view addSubview:self.lineView];
    self.selectedBackgroundView = self.view;
    
}

-(void)layoutSubviews{
    [super layoutSubviews];
    self.nameLabel.frame = self.contentView.bounds;
    self.nameLabel.textAlignment = NSTextAlignmentCenter;
}

-(void)setTypeModel:(TypeModel *)typeModel{
    
    _typeModel = typeModel;
    self.nameLabel.text = typeModel.name;
    
}


@end
